package com.da.javatest.niuke.jianzhi;

/**
 * @author chenlida
 * @date 2020/10/18 18:01
 * https://www.nowcoder.com/practice/abc3fe2ce8e146608e868a70efebf62e?
 * tpId=13&tags=&title=&diffculty=0&judgeStatus=0&rp=1
 */
public class C1Solution {
    /**
     * 1  2  3  4
     * 5  6  7  8
     * 9  10 11 12
     * 13 14 15 16
     */
    public boolean Find(int target, int[][] array) {
        int l = array[0].length;
        for (int[] ints : array) {
            for (int j = l - 1; j >= 0; j--) {
                if (ints[j] == target) {
                    return true;
                }
                if (ints[j] < target) {
                    break;
                }
            }
        }
        return false;
    }
}
